<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Staff extends CI_Controller
{
	public function index()
	{
		$this->load->model('User_Model','',true);
		$mydata =$this->User_Model->query_all_number_name();
		$data['member']=$mydata['member'];
		$data['ID']=$mydata['ID'];
		$this->load->view('Staff',$data);
	   
	}
	
	/*
	 * 从前台ajax接受用户的 ID ，该ID为用户在数据库中的编号
	 * 
	 */
	public function detail()
	{
		$this->load->model('User_Model','',true);
		$this->load->library('json');
		$id = $this->input->post('uid',true);
		$query = $this->User_Model->query_user_id($id);
		$result=$this->json->to_json($query);
		echo $result;
	}
	
	/**
	 * 从前台接受ajax传过来的参数，该参数为该用户的ID
	 * 然后根据该ID返回从数据库中查询的信息；
	 */
	public function project()
	{
		$this->load->model('Project_Model','',true);
		$id = $this->input->post('uid',true);
		$query = $this->Project_Model->query_project_uid($id);
		$result = json_encode($query);
		echo  $result;
	}
		
	/*
	 * 从前台接受用户信息，修改当前用户的信息
	 */
	public function modify()
	{
		$name = $this->input->post('name',true);
		$sex = $this->input->post('sex',true);
		$birth = $this->input->post('birth',true);
		$major = $this->input->post('major',true);
		$per = $this->input->post('per',true);
		$mark = $this->input->post('mark',true);
		$data = array('name'=>$name,'sex'=>$sex,'birth'=>$birth,
				'major'=>$major,'per'=>$per,'mark'=>$mark);
		
	}
}
	